<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Version Checking</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="Pango Reference Manual">
<link rel="up" href="lowlevel.html" title="Low Level Functionality">
<link rel="prev" href="pango-Miscellaneous-Utilities.html" title="Miscellaneous Utilities">
<link rel="next" href="tools.html" title="Pango Tools">
<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="pango-Miscellaneous-Utilities.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="lowlevel.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">Pango Reference Manual</th>
<td><a accesskey="n" href="tools.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#pango-Version-Checking.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#pango-Version-Checking.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry">
<a name="pango-Version-Checking"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="pango-Version-Checking.top_of_page"></a>Version Checking</span></h2>
<p>Version Checking — Tools for checking Pango version at compile- and run-time.</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="pango-Version-Checking.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">#define             <a class="link" href="pango-Version-Checking.html#PANGO-VERSION-ENCODE:CAPS" title="PANGO_VERSION_ENCODE()">PANGO_VERSION_ENCODE</a>                (major,
                                                         minor,
                                                         micro)
#define             <a class="link" href="pango-Version-Checking.html#PANGO-VERSION:CAPS" title="PANGO_VERSION">PANGO_VERSION</a>
#define             <a class="link" href="pango-Version-Checking.html#PANGO-VERSION-MAJOR:CAPS" title="PANGO_VERSION_MAJOR">PANGO_VERSION_MAJOR</a>
#define             <a class="link" href="pango-Version-Checking.html#PANGO-VERSION-MINOR:CAPS" title="PANGO_VERSION_MINOR">PANGO_VERSION_MINOR</a>
#define             <a class="link" href="pango-Version-Checking.html#PANGO-VERSION-MICRO:CAPS" title="PANGO_VERSION_MICRO">PANGO_VERSION_MICRO</a>
#define             <a class="link" href="pango-Version-Checking.html#PANGO-VERSION-STRING:CAPS" title="PANGO_VERSION_STRING">PANGO_VERSION_STRING</a>
#define             <a class="link" href="pango-Version-Checking.html#PANGO-VERSION-CHECK:CAPS" title="PANGO_VERSION_CHECK()">PANGO_VERSION_CHECK</a>                 (major,
                                                         minor,
                                                         micro)
<span class="returnvalue">int</span>                 <a class="link" href="pango-Version-Checking.html#pango-version" title="pango_version ()">pango_version</a>                       (<em class="parameter"><code><span class="type">void</span></code></em>);
const <span class="returnvalue">char</span> *        <a class="link" href="pango-Version-Checking.html#pango-version-string" title="pango_version_string ()">pango_version_string</a>                (<em class="parameter"><code><span class="type">void</span></code></em>);
const <span class="returnvalue">char</span> *        <a class="link" href="pango-Version-Checking.html#pango-version-check" title="pango_version_check ()">pango_version_check</a>                 (<em class="parameter"><code><span class="type">int</span> required_major</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> required_minor</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> required_micro</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="pango-Version-Checking.description"></a><h2>Description</h2>
<p>
The capital-letter macros defined here can be used to check the version of
Pango at compile-time, and to <em class="firstterm">encode</em> Pango versions into
integers.
The functions can be used to check the version of the linked Pango library
at run-time.
</p>
</div>
<div class="refsect1">
<a name="pango-Version-Checking.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="PANGO-VERSION-ENCODE:CAPS"></a><h3>PANGO_VERSION_ENCODE()</h3>
<pre class="programlisting">#define             PANGO_VERSION_ENCODE(major, minor, micro)</pre>
<p>
This macro encodes the given Pango version into an integer.  The numbers
returned by <a class="link" href="pango-Version-Checking.html#PANGO-VERSION:CAPS" title="PANGO_VERSION"><code class="literal">PANGO_VERSION</code></a> and <a class="link" href="pango-Version-Checking.html#pango-version" title="pango_version ()"><code class="function">pango_version()</code></a> are encoded using this macro.
Two encoded version numbers can be compared as integers.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>major</code></em> :</span></p></td>
<td>the major component of the version number</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>minor</code></em> :</span></p></td>
<td>the minor component of the version number</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>micro</code></em> :</span></p></td>
<td>the micro component of the version number</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="PANGO-VERSION:CAPS"></a><h3>PANGO_VERSION</h3>
<pre class="programlisting">#define             PANGO_VERSION</pre>
<p>
The version of Pango available at compile-time, encoded using
<a class="link" href="pango-Version-Checking.html#PANGO-VERSION-ENCODE:CAPS" title="PANGO_VERSION_ENCODE()"><code class="function">PANGO_VERSION_ENCODE()</code></a>.
</p>
</div>
<hr>
<div class="refsect2">
<a name="PANGO-VERSION-MAJOR:CAPS"></a><h3>PANGO_VERSION_MAJOR</h3>
<pre class="programlisting">#define PANGO_VERSION_MAJOR 1
</pre>
<p>
The major component of the version of Pango available at compile-time.
</p>
</div>
<hr>
<div class="refsect2">
<a name="PANGO-VERSION-MINOR:CAPS"></a><h3>PANGO_VERSION_MINOR</h3>
<pre class="programlisting">#define PANGO_VERSION_MINOR 29
</pre>
<p>
The minor component of the version of Pango available at compile-time.
</p>
</div>
<hr>
<div class="refsect2">
<a name="PANGO-VERSION-MICRO:CAPS"></a><h3>PANGO_VERSION_MICRO</h3>
<pre class="programlisting">#define PANGO_VERSION_MICRO 4
</pre>
<p>
The micro component of the version of Pango available at compile-time.
</p>
</div>
<hr>
<div class="refsect2">
<a name="PANGO-VERSION-STRING:CAPS"></a><h3>PANGO_VERSION_STRING</h3>
<pre class="programlisting">#define PANGO_VERSION_STRING "1.29.4"
</pre>
<p>
A string literal containing the version of Pango available at compile-time.
</p>
</div>
<hr>
<div class="refsect2">
<a name="PANGO-VERSION-CHECK:CAPS"></a><h3>PANGO_VERSION_CHECK()</h3>
<pre class="programlisting">#define             PANGO_VERSION_CHECK(major,minor,micro)</pre>
<p>
Checks that the version of Pango available at compile-time is not older than
the provided version number.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>major</code></em> :</span></p></td>
<td>the major component of the version number</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>minor</code></em> :</span></p></td>
<td>the minor component of the version number</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>micro</code></em> :</span></p></td>
<td>the micro component of the version number</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="pango-version"></a><h3>pango_version ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>                 pango_version                       (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
This is similar to the macro <a class="link" href="pango-Version-Checking.html#PANGO-VERSION:CAPS" title="PANGO_VERSION"><code class="literal">PANGO_VERSION</code></a> except that
it returns the encoded version of Pango available at run-time,
as opposed to the version available at compile-time.
</p>
<p>
A version number can be encoded into an integer using
<a class="link" href="pango-Version-Checking.html#PANGO-VERSION-ENCODE:CAPS" title="PANGO_VERSION_ENCODE()"><code class="function">PANGO_VERSION_ENCODE()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>The encoded version of Pango library
available at run time.</td>
</tr></tbody>
</table></div>
<p class="since">Since 1.16</p>
</div>
<hr>
<div class="refsect2">
<a name="pango-version-string"></a><h3>pango_version_string ()</h3>
<pre class="programlisting">const <span class="returnvalue">char</span> *        pango_version_string                (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
This is similar to the macro <a class="link" href="pango-Version-Checking.html#PANGO-VERSION-STRING:CAPS" title="PANGO_VERSION_STRING"><code class="literal">PANGO_VERSION_STRING</code></a> except that
it returns the version of Pango available at run-time, as opposed to
the version available at compile-time.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A string containing the version of Pango library
available at run time.
The returned string is owned by Pango and should not be modified
or freed.</td>
</tr></tbody>
</table></div>
<p class="since">Since 1.16</p>
</div>
<hr>
<div class="refsect2">
<a name="pango-version-check"></a><h3>pango_version_check ()</h3>
<pre class="programlisting">const <span class="returnvalue">char</span> *        pango_version_check                 (<em class="parameter"><code><span class="type">int</span> required_major</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> required_minor</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> required_micro</code></em>);</pre>
<p>
Checks that the Pango library in use is compatible with the
given version. Generally you would pass in the constants
<a class="link" href="pango-Version-Checking.html#PANGO-VERSION-MAJOR:CAPS" title="PANGO_VERSION_MAJOR"><code class="literal">PANGO_VERSION_MAJOR</code></a>, <a class="link" href="pango-Version-Checking.html#PANGO-VERSION-MINOR:CAPS" title="PANGO_VERSION_MINOR"><code class="literal">PANGO_VERSION_MINOR</code></a>, <a class="link" href="pango-Version-Checking.html#PANGO-VERSION-MICRO:CAPS" title="PANGO_VERSION_MICRO"><code class="literal">PANGO_VERSION_MICRO</code></a>
as the three arguments to this function; that produces
a check that the library in use at run-time is compatible with
the version of Pango the application or module was compiled against.
</p>
<p>
Compatibility is defined by two things: first the version
of the running library is newer than the version
<em class="parameter"><code>required_major.required_minor</code></em>.<em class="parameter"><code>required_micro</code></em>. Second
the running library must be binary compatible with the
version <em class="parameter"><code>required_major.required_minor</code></em>.<em class="parameter"><code>required_micro</code></em>
(same major version.)
</p>
<p>
For compile-time version checking use <a class="link" href="pango-Version-Checking.html#PANGO-VERSION-CHECK:CAPS" title="PANGO_VERSION_CHECK()"><code class="function">PANGO_VERSION_CHECK()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>required_major</code></em> :</span></p></td>
<td>the required major version.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>required_minor</code></em> :</span></p></td>
<td>the required minor version.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>required_micro</code></em> :</span></p></td>
<td>the required major version.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a> if the Pango library is compatible with the
given version, or a string describing the version mismatch.
The returned string is owned by Pango and should not be modified
or freed.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 1.16</p>
</div>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.18</div>
</body>
</html>